package entities;

import util.DataVerify;

public class Song extends Product 
{
	private String lyrics;
	private String genre;

	
	/**
	 * 
	 */
	public Song() {
	}

	public Song(String lyrics, String genre, Long product_id, String price, String dateAdded,
			String title, String duration, String productionDate,
			String format, int stockQty, String img) {
		super(product_id, price, dateAdded, title, duration, productionDate,
				format, stockQty, img);
		this.lyrics = lyrics;
		this.genre = genre;
	}


	public String getLyrics() {
		return lyrics;
	}


	public void setLyrics(String lyrics) {
		this.lyrics = lyrics;
	}


	public String getGenre() {
		return genre;
	}


	public void setGenre(String genre) {
		this.genre = genre;
	}


	public static Song newInstance(String lyrics, String genre, Long product_id, String price, String dateAdded,
			String title, String duration, String productionDate,
			String format, int stockQty, String img){
		DataVerify.verifyObject("lyrics",lyrics);
		DataVerify.verifyObject("genre",genre);
		DataVerify.verifyObject("product_id",product_id);
		DataVerify.verifyObject("stock_price",Float.valueOf(price));
		DataVerify.verifyObject("dateAdded",dateAdded);
		DataVerify.verifyObject("title",title);
		DataVerify.verifyObject("duration",duration);
		DataVerify.verifyObject("productionDate",productionDate);
		DataVerify.verifyObject("format",format);
		DataVerify.verifyObject("stockQty",stockQty);
		DataVerify.verifyObject("img",img);
		DataVerify.verifyObject("price",price);

		return new Song(lyrics, genre, product_id, price, dateAdded,
				title, duration, productionDate,
				format, stockQty, img);
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Song other = (Song) obj;
		if (genre == null) {
			if (other.genre != null)
				return false;
		} else if (!genre.equals(other.genre))
			return false;
		if (lyrics == null) {
			if (other.lyrics != null)
				return false;
		} else if (!lyrics.equals(other.lyrics))
			return false;
		return true;
	}

	
	
}
